package DB;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;

public class javaconnect {

    Connection conn = null;

    public static Connection ConnecrDb() {
        try {
            Class.forName(" ..... "); // connection to db progr.
            Connection conn = DriverManager.getConnection("....."); // connection to DB
            return conn;
        } catch (SQLException e) {
            JOptionPane.showMessageDialog(null, e);
            return null;
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(javaconnect.class.getName()).log(Level.SEVERE, null, ex);
            return null;

        }
    }

}
